﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using VehicleMaintenance.Comm;

namespace VehicleMaintenance.Models
{
    public class SalesReturnsBill
    {
        [Key]
        public int ID { get; set; }

        [Display(Name = "退货单号")]
        [Required(ErrorMessage = "退货单号不能为空")]
        public string Code { get; set; }

        [Display(Name = "仓库")]
        public string Position { get; set; }

        [Display(Name = "客户")]
        [Required(ErrorMessage = "客户名称不能为空")]
        public int CustomerID { get; set; }

        [Display(Name = "联系电话")]
        public string TelePhone { get; set; }

        [Display(Name = "退货日期")]
        [ControlTypeAttribute(Type = "DateTimePicker")]
        public string Date { get; set; }

        [Display(Name = "商品编号")]
        [Required(ErrorMessage = "商品编号不能为空")]
        public int GoodID { get; set; }

        [Display(Name = "商品名称")]
        [Required(ErrorMessage = "商品名称不能为空")]
        public string GoodName { get; set; }

        [Display(Name = "车型")]
        [Required(ErrorMessage = "车型不能为空")]
        public int CarTypeID { get; set; }

        [Display(Name = "退货数量")]
        [Required(ErrorMessage = "退货数量不能为空")]
        public int Number { get; set; }

        [Display(Name = "单位")]
        public string Units { get; set; }

        [Display(Name = "进价")]
        public decimal PurchasePrice { get; set; }

        [Display(Name = "退货价")]
		[Required(ErrorMessage = "退货价不能为空")]
        public decimal ReturnValue { get; set; }

        [Display(Name = "退货金额")]
		[Required(ErrorMessage = "退货金额不能为空")]
        public decimal ReturnPrice { get; set; }

        [Display(Name = "付款方式")]
        [ControlTypeAttribute(Type = "ComboBox", Values = new string[] { "现金" })]
        public string Payment { get; set; }

        [Display(Name = "业务员")]
        [Required(ErrorMessage = "业务员不能为空")]
        public int StaffID { get; set; }

        [Display(Name = "产地")]
        public string PlaceOfOrigin { get; set; }

        [Display(Name = "备注")]
        public string Remark { get; set; }

        public Goods Good { get; set; }

        public CarType CarType { get; set; }

        public Staff Staff { get; set; }

		public Customer Customer { get; set; }
    }
}
